import { createWebHashHistory } from 'vue-router'
/*
 * @Description: 导出常用的全局组件
 * @Date: 2021-04-14 17:48:49 +0800
 * @Author: JackChou
 * @LastEditTime: 2021-04-16 11:09:05 +0800
 * @LastEditors: JackChou
 */
import { App } from '@/model/index'
import { Component } from 'vue'
import Aside from './aside/index.vue'
interface ComponentOptions {
  name: String
}
// NOTE 联合类型:往某个类型里添加属性
const components: (Component & ComponentOptions)[] = [Aside]
export const setupComponents = (app: App) => {
  components.forEach(component => {
    app.component(component.name, component)
  })
  // 返回 app 以实现链式调用
  return app
}
